﻿using System;
using System.Collections.Generic;
using System.Text;
using ERP.DAL.Base;
using System.Data;
using ERP.DAL;

namespace ERP.BusinessEntities.Base
{
    public class BaseBusinessController:IDal
    {
        public IDal dal;        

        #region Read
        public DataSet GetDataset(String strQuery)
        {
            return dal.GetDataset(strQuery);
        }

        public Object GetObjectFromDataRow(DataRow datarow)
        {
            return dal.GetObjectFromDataRow(datarow);
        }

        public List<Object> GetListObject(DataSet ds)
        {
            return dal.GetListObject(ds);
        }

        public void GetListObject(DataSet ds, List<Object> lst)
        {
            dal.GetListObject(ds, lst);
        }

        public DataSet GetAllObjects()
        {
            return dal.GetAllObjects();
        }

        public Object GetObjectById(int ObjectID)
        {
            return dal.GetObjectById(ObjectID);
        }

        public DataSet GetAllObjectByColumnValue(String strColumn, object value)
        {
            return dal.GetAllObjectByColumnValue(strColumn, value);
        }

        public DataSet GetDataSetByCondition(String strConditions)
        {
            return dal.GetDataSetByCondition(strConditions);
        }

        public DataSet GetCustomDataSetByCondition(string strSelectClause, string strConditions)
        {
            return dal.GetCustomDataSetByCondition(strSelectClause, strConditions);
        }
        #endregion

        #region Update
        public int Update(BaseBusinessInfo businessObj)
        {
            return dal.Update(businessObj);
        }
        public void UpdateList(List<BaseBusinessInfo> lstObj)
        {
            dal.UpdateList(lstObj);
        }
        #endregion

        #region Insert
        public int CreateObject(BaseBusinessInfo businessObj)
        {
            return dal.CreateObject(businessObj);
        }
        #endregion

        #region Delete
        public void PermanentDeleteObject(BaseBusinessInfo Obj)
        {
            dal.PermanentDeleteObject(Obj);
        }
        public void Delete(BaseBusinessInfo Obj)
        {
            dal.Delete(Obj);
        }

        public void Delete(int iObjID)
        {
            dal.Delete(iObjID);
        }

        public void DeleteAllByParentID(String strForeignColumn, int iParentID)
        {
            dal.DeleteAllByParentID(strForeignColumn, iParentID);
        }

        #endregion

        
    }
}
